﻿@model OrderControllerModel.Index
<div class="ui-box ui-box-alpha">
    <div class="ui-box-head">
        <div class="ui-box-head-border">
            <div class="ui-box-head-title">
                收银台</div>
            <span class="ui-box-head-text">@Model.GetOrderCategory()</span> <a href="#" class="ui-box-head-more">
                去购物</a>
        </div>
    </div>
    <div class="ui-box-container">
        <div class="ui-box-content ui-box-content-special">
            <div class="row-fluid">
                <div class="span4">
                    您的账户： <span class="ft-weight-bold">@(User.Identity.Name)</span>
                </div>
                <div class="span4">
                    账户余额：<span class="ft-green ft-weight-bold">
                        @(Model.Account.AvailableCash.ToString("N"))<small class="ft-gray ft-weight-normal">(元)</small></span>
                </div>
                <div class="span4">
                    <a href="/recharge" target="_blank">充值</a>
                </div>
            </div>
        </div>
    </div>
    <div class="ui-box-container-noborder">
        <div class="ui-box-content">
        </div>
    </div>
    <div class="ui-box-container-noborder">
        <div class="ui-box-container-head">
            <div class="row-fluid">
                <div class="span8">
                    @(Model.Trade.Title)
                    @*<a class="ft-weight-normal" href="javascript:void(0);" onclick='$("#trade-info").slideToggle();'>
                        详细信息</a>*@
                </div>
                <div class="span2">
                </div>
                <div class="span2">
                    <div class="row-fluid">
                        <div class="span7">
                            <span class="payment-amount">
                                @(Model.Trade.Amount.ToString("N"))<small>元</small></span>
                        </div>
                        <div class="offset1 span4">
                            <a class="payment-refresh-price" href="/order?param=@(Model.Trade.Id)">刷 新</a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="ui-box-content">
            <div id="trade-info">
                <div class="row-fluid">
                    afaf
                </div>
            </div>
        </div>
        <div class="ui-box-content">
            @if (Model.Account.AvailableCash > 0 && (Model.Account.AvailableCash >= Model.Trade.Amount))
            {
                <div class="payment-account">
                    <form id="pay-by-debit-balance" class="form-horizontal" action="/order/balance?param=@(Model.Trade.Id)" method="post" onsubmit="return balancePay(this);">
                    <div class="control-group">
                        <div class="controls">
                            使用账户余额支付 <span class="ft-weight-bold" style="color: #FF6600;">
                                @(Model.Trade.Amount.ToString("N"))<small class="ft-gray ft-weight-normal">(元)</small></span>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="password">
                            支付密码：</label>
                        <div class="controls">
                            <input type="password" id="password" name="password" maxlength="12" placeholder="请输入您的密码" />
                        </div>
                    </div>
                    <div class="form-actions" style="margin: 0;">
                    @Html.AntiForgeryToken()
                        <button class="ui-btn ui-btn-alpha" type="submit">
                            确认付款</button>
                    </div>
                    </form>
                </div>
            }
            <div class="payment-account">
                <div class="tabbable">
                    <ul class="nav nav-tabs pl-300 f-18">
                        @if (Model.Account.AvailableCash > 0 && (Model.Account.AvailableCash >= Model.Trade.Amount))
                        {
                            <li>您可以使用其他方式付款：</li>
                        }
                        else
                        {
                            <li>请选择付款方式：</li>
                        }
                        <li class="active"><a href="#1" data-toggle="tab">储蓄卡</a></li>
                        <li><a href="#2" data-toggle="tab">信用卡</a></li>
                        <li><a href="#3" data-toggle="tab">现金或刷卡</a></li>
                        <li><a href="#4" data-toggle="tab">消费卡</a></li>
                    </ul>
                    <div class="tab-content">
                        <div class="tab-pane active" id="1">
                            @if (Model.Account.AvailableCash > 0 && (Model.Account.AvailableCash < Model.Trade.Amount))
                            {
                                <div class="ebank">
                                    <div class="row-fluid">
                                        <label class="checkbox" style="margin-top: 5px; cursor: pointer;">
                                            <input type="checkbox" value="True" />
                                            使用账户余额支付 <span class="ft-weight-bold" style="color: #FF6600;">
                                                @(Model.Trade.Amount.ToString("N"))<small class="ft-gray ft-weight-normal">(元)</small></span></label>
                                    </div>
                                </div>
                            }
                            <form id="pay-by-debit-card" action="/payment/balance" method="post">
                            <div class="ebank ebank-express">
                                <div>
                                    <h4>
                                        快捷支付</h4>
                                </div>
                                <ul class="unstyled inline">
                                    @foreach (var e in Model.EBanks)
                                    {
                                        <li>
                                            <label title="@(e.PaymentBank.Name)">
                                                <input type="radio" name="bank" value="@(e.Id)" data-platform="@(e.PlatformId)"/>
                                                <img alt="@(e.PaymentBank.Name)" src="@(WebSite.Static + e.PaymentBank.Image)" />
                                            </label>
                                        </li>
                                    }
                                </ul>
                            </div>
                            <div class="ebank">
                                <div>
                                    <h4>
                                        网银支付</h4>
                                </div>
                                <ul class="unstyled inline">
                                    @foreach (var e in Model.EBanks)
                                    {
                                        <li>
                                            <label title="@(e.PaymentBank.Name)">
                                                <input type="radio" name="bank" value="@(e.Id)" data-platform="@(e.PlatformId)"/>
                                                <img alt="@(e.PaymentBank.Name)" src="@(WebSite.Static + e.PaymentBank.Image)" />
                                            </label>
                                        </li>
                                    }
                                </ul>
                            </div>
                            </form>
                            <div class="form-actions" style="margin: 0;">
                                <button class="btn btn-large">
                                    下一步</button>
                            </div>
                        </div>
                        <div class="tab-pane" id="2">
                            <form id="pay-by-credit-card" action="/payment/bank" method="post">
                            </form>
                        </div>
                        <div class="tab-pane" id="3">
                            <form id="pay-by-cash" action="/payment/bank" method="post">
                            </form>
                        </div>
                        <div class="tab-pane" id="4">
                            <form id="pay-by-debit-consumer-card" action="/payment/bank" method="post">
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
@section js{
    <script type="text/javascript">
        function payConfirm(obj) {
            var password = document.getElementById('password');
            if (password != "") {
                return true;
            }
            else {
                alert(0);
                return false;
            }
            
        }       
    </script>
}
